home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-02 | 1.8 KB | 83 lines | [TEXT/KAHL] |
- /*
- File: Tester.c
-
- Contains: Tester for loader component.
-
- Note that this tester is only for use with the loader
- component linked in (hence, make sure that the
- BUILD_LINKED flag in CompileFlags.h is uncommented).
-
- Refer to develop Issue 15, "Managing Component Registration",
- for details on this code.
-
- Written by: Gary Woodcock
-
- Copyright: © 1993 by Apple Computer, Inc.
-
- Change History (most recent first):
-
- */
-
- //-----------------------------------------------------------------------
- // Includes
-
- #include <Components.h>
- #include <QuickDraw.h>
- #include <Fonts.h>
- #include <OSEvents.h>
- #include <Windows.h>
- #include <Menus.h>
- #include <TextEdit.h>
- #include <Dialogs.h>
- #include <Movies.h>
-
- #include "LoaderPrivate.h"
-
- //-----------------------------------------------------------------------
-
- // Some glue to generate the register message to the loader component when
- // we're running linked
- pascal ComponentResult
- ComponentRegister (ComponentInstance ci) = {0x2F3C, 0x00, 0xFFFB, 0x7000, 0xA82A};
-
- //-----------------------------------------------------------------------
-
- main (void)
- {
- Component loaderCompID;
- ComponentInstance loader;
- ComponentResult result = noErr;
-
- // MacMantra™
- MaxApplZone();
- InitGraf (&qd.thePort);
- InitFonts();
- FlushEvents (everyEvent, 0);
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs (0L);
- InitCursor();
- EnterMovies();
- MoreMasters();
- MoreMasters();
-
- #ifdef BUILD_LINKED
-
- // Register the loader component
- loaderCompID = RegisterLoader();
-
- // Mimic the register sequence that the Component Manager performs
- // when the cmpWantsRegisterMessage flag is set
- loader = OpenComponent (loaderCompID);
- result = ComponentRegister (loader);
- result = CloseComponent (loader);
-
- #endif BUILD_LINKED
-
- // Am-scray
- ExitToShell();
- }
-
- //-----------------------------------------------------------------------
-